//auto gen by paipai.java.augogen ver 154
//author floatman
#ifndef _STORAGEAO_STORAGE_H_
#define _STORAGEAO_STORAGE_H_

#include <stdint.h>
#include <string>
#include <iostream>
#include "app_platform/help_macros.h"
#include "app_platform/intf_service.h"
#include "intf_storageao.h"

#include "library/basic/singleton_t.h"
#include "library/basic/sync_lock.h"
#include "c2cent/library/log/CWTimeElf3.h"

#include <set>
#include <map>
#include <vector>
#include "erp/storage/po/disassemblebillpo_storage.h"
#include "erp/storage/po/losebillpo_storage.h"
#include "erp/storage/po/overflowbillpo_storage.h"
#include "erp/storage/po/stockpo_storage.h"
#include "erp/storage/po/stockcheckmasterpo_storage.h"
#include "erp/storage/po/disassemblebillfilterpo_storage.h"
#include "erp/storage/po/overflowbillorlosebillfilterpo_storage.h"
#include "erp/storage/po/stockbranch_relpo_storage.h"
#include "erp/storage/po/stockcheckfilterpo_storage.h"
#include "erp/storage/po/stockfilterpo_storage.h"

HEADER_SELF_DEFINE_START
/**
*  请在这里增加自定义包含的头文件，否则无法合并代码
**/
HEADER_SELF_DEFINE_END

namespace erp
{
namespace storage
{
namespace ao
{

#define STORAGEAO_SERVICE_VERSION "ERP_STORAGE_AO___STORAGEAO__SERVICE_VERSION__1.0 2013-11-01 14:15:47"
const std::string STORAGEAO_SERVICE_NOUSE = STORAGEAO_SERVICE_VERSION;

SERVICE class CStorageAo : public IStorageAo{
public:
		CStorageAo(enum DeployMethod method = DEPLOY_STANDALONE);
		~CStorageAo();
		 void Reset();
		static int Initialize(IUserDefineCntl* pCntl = NULL);

public:
	 /**
	 *
	 *    写入仓库信息 
	 *
	 */
	EXPORT(0xc05f1801) uint32_t AddStock(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::storage::po::CStockPo& oStockInfo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve,
		 uint64_t& ddwStockSysNo
		);

	 /**
	 *
	 *    逻辑删除仓库信息 
	 *
	 */
	EXPORT(0xc05f1802) uint32_t DeleteStock(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const std::set<uint64_t> & setFStockSysNo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::map<uint64_t,uint32_t> & mapErrorCode,
		 std::map<uint64_t,std::string> & mapErrorMsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    修改仓库信息 
	 *
	 */
	EXPORT(0xc05f1803) uint32_t UpdateStock(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::storage::po::CStockPo& oStockInfo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    根据ID获取仓库信息 
	 *
	 */
	EXPORT(0xc05f1804) uint32_t GetStockBySysNos(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 const std::set<uint64_t> & setStockSysnoList,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::vector<erp::storage::po::CStockPo> & vecStockList,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    根据filter获取仓库信息 
	 *
	 */
	EXPORT(0xc05f1805) uint32_t GetStockList(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 const erp::storage::po::CStockFilterPo& oStockFilter,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 uint32_t& dwTotal,
		 std::vector<erp::storage::po::CStockPo> & vecStockList,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    维护仓库与分支机构关系 
	 *
	 */
	EXPORT(0xc05f1806) uint32_t ModifyStockBranch_Rel(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 uint64_t ddwStockSysNo,
		 const std::set<uint64_t> & setBranchSysNos,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    查询仓库与分支机构关系 
	 *
	 */
	EXPORT(0xc05f1807) uint32_t GetStockBranch_RelBySysNo(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 uint64_t ddwStockSysNo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve,
		 std::vector<erp::storage::po::CStockBranch_RelPo> & vecStockBranchList
		);

	 /**
	 *
	 *    写入报损/报溢表 
	 *
	 */
	EXPORT(0xc05f1808) uint32_t AddLoseBillOrOverFlowBill(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::storage::po::CLoseBillPo& oLoseBillInfo,
		 const erp::storage::po::COverFlowBillPo& oOverFlowBillInfo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve,
		 uint64_t& ddwOverFlowBillSysNo
		);

	 /**
	 *
	 *    逻辑删除报损/报溢表  
	 *
	 */
	EXPORT(0xc05f1809) uint32_t DeleteLoseBillOrOverFlowBill(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const std::set<uint64_t> & setFLoseBillSysNo,
		 const std::set<uint64_t> & setFOverFlowBillSysNo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::map<uint64_t,uint32_t> & mapErrorCode,
		 std::map<uint64_t,std::string> & mapErrorMsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    修改报损/报溢表 
	 *
	 */
	EXPORT(0xc05f1810) uint32_t UpdataLoseBillOrOverFlowBill(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::storage::po::CLoseBillPo& oLoseBillInfo,
		 const erp::storage::po::COverFlowBillPo& oOverFlowBillInfo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    根据ID获取报损/报溢表信息 
	 *
	 */
	EXPORT(0xc05f1811) uint32_t GetLoseBillOrOverFlowBillBySysNos(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 const std::set<uint64_t> & setLoseBillSysNoList,
		 const std::set<uint64_t> & setOverFlowSysNoList,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::vector<erp::storage::po::CLoseBillPo> & vecLoseBillList,
		 std::vector<erp::storage::po::COverFlowBillPo> & vecOverFlowList,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    根据filter获取报损/报溢表
	 *
	 */
	EXPORT(0xc05f1812) uint32_t GetLoseBillOrOverFlowBillList(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 const erp::storage::po::COverFlowBillOrLoseBillFilterPo& oOverFlowBillOrLoseBillFilter,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 uint32_t& dwTotal,
		 std::vector<erp::storage::po::CLoseBillPo> & vecLoseBillList,
		 std::vector<erp::storage::po::COverFlowBillPo> & vecOverFlowList,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    拆装单创建 
	 *
	 */
	EXPORT(0xc05f1813) uint32_t AddDisassembleBill(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::storage::po::CDisassembleBillPo& oDisassembleBillInfo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve,
		 uint64_t& ddwDisassembleBillSysNo
		);

	 /**
	 *
	 *    拆装单删除（逻辑） 
	 *
	 */
	EXPORT(0xc05f1814) uint32_t DeleteDisassembleBill(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const std::set<uint64_t> & setDisassemblebillSysNos,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::map<uint64_t,uint32_t> & mapErrorCode,
		 std::map<uint64_t,std::string> & mapErrorMsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    拆装单修改 
	 *
	 */
	EXPORT(0xc05f1815) uint32_t UpdataDisassembleBill(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::storage::po::CDisassembleBillPo& oDisassembleBillInfo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    拆装单查询（主键） 
	 *
	 */
	EXPORT(0xc05f1816) uint32_t GetDisassembleBillBySysNos(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 const std::set<uint64_t> & setDisassembleBillSysnoList,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::vector<erp::storage::po::CDisassembleBillPo> & vecDisassembleBillList,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    拆装单列表（列表过滤） 
	 *
	 */
	EXPORT(0xc05f1817) uint32_t GetDisassembleBillList(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 const erp::storage::po::CDisassembleBillFilterPo& oDisassembleBillFilter,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 uint32_t& dwTotal,
		 std::vector<erp::storage::po::CDisassembleBillPo> & vecDisassembleBillList,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    盘点单创建 
	 *
	 */
	EXPORT(0xc05f1818) uint32_t AddStockCheck(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::storage::po::CStockCheckMasterPo& oStockCheckMasterInfo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve,
		 uint64_t& ddwStockCheckMasterSysNo
		);

	 /**
	 *
	 *    盘点单删除（逻辑） 
	 *
	 */
	EXPORT(0xc05f1819) uint32_t DeleteStockCheck(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const std::set<uint64_t> & setStockCheckMasterSysNos,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::map<uint64_t,uint32_t> & mapErrorCode,
		 std::map<uint64_t,std::string> & mapErrorMsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    盘点单修改 
	 *
	 */
	EXPORT(0xc05f1820) uint32_t UpdataStockCheck(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::storage::po::CStockCheckMasterPo& oStockCheckMasterInfo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    盘点单查询（主键） 
	 *
	 */
	EXPORT(0xc05f1821) uint32_t GetStockCheckBySysNos(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 const std::set<uint64_t> & setStockCheckMasterSysNoList,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::vector<erp::storage::po::CStockCheckMasterPo> & vecStockCheckList,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   盘点单列表（列表过滤） 
	 *
	 */
	EXPORT(0xc05f1822) uint32_t GetStockCheckList(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 const erp::storage::po::CStockCheckFilterPo& oStockCheckFilterPo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 uint32_t& dwTotal,
		 std::vector<erp::storage::po::CStockCheckMasterPo> & vecStockCheckList,
		 std::string& strOutReserve
		);

SECTION_SELF_DEFINE_START
/**
* 请在这里增加自定义的成员变量和函数，否则无法合并代码
**/

private:
	int32_t CheckCommPara();
	int32_t CheckStockFilter(const erp::storage::po::CStockFilterPo& oStockFilter);
	int32_t CheckStockInfo(const erp::storage::po::CStockPo& oStockInfo);


private:
		std::string m_strMachineKey;
        std::string m_strSource;
        uint32_t m_dwSceneId;
        uint32_t m_dwOperatorUin;

        static uint32_t s_dwPageSizeLimit;
        static std::bitset<32> s_bitsetValidPropertyBit;

SECTION_SELF_DEFINE_END

private:
	enum DeployMethod m_method;
};

}
}
}

#endif /* _STORAGEAO_STORAGE_H_ */
